import 'package:flutter_nb_net/flutter_net.dart';

class AlarmListResp extends BaseNetModel {
  int? code;
  String? msg;
  List<AlarmData>? rows;
  int? total;

  AlarmListResp({this.code, this.msg, this.rows, this.total});

  @override
  fromJson(Map<String, dynamic> json) {
    return AlarmListResp(
      code: json['code'],
      msg: json['msg'],
      rows: json['rows'] != null ? List<AlarmData>.from(json['rows'].map((x) => AlarmData().fromJson(x))) : null,
      total: json['total'],
    );
  }
}

class AlarmData extends BaseNetModel {
  String? deviceId;
  String? deviceName;
  String? model;
  DateTime? occurTime;
  String? warnDesc;

  AlarmData({this.deviceId, this.deviceName, this.model, this.occurTime, this.warnDesc});

  @override
  fromJson(Map<String, dynamic> json) {
    return AlarmData(
      deviceId: json['deviceId'],
      deviceName: json['deviceName'],
      model: json['model'],
      occurTime: DateTime.parse(json['occurTime']),
      warnDesc: json['warnDesc'],
    );
  }


}